<script>
	var swfu_
	$(function(){
	var btn = $("#upbtn").get(0);
    swfu_= new SWFUpload({
    		upload_url: "/upload/upload",
            file_post_name: "filedata",
			file_size_limit : "1 MB",
			file_types : "*.jpg;*.png;*.jpeg'*.bmp",
			file_types_description : "bmp,jpeg,jpg,png图片",
			file_upload_limit :5,
			post_params : {
	           "bizType" : "SHOP",
	           "fileType" : "IMAGE",
	           "fileName" : ""
		    },
			swfupload_preload_handler : preLoad,
			swfupload_load_failed_handler : loadFailed,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : function(f,data){
				eval("var json="+data+";");
				if(json.message=="Success!"){
					var htmstr="";
					htmstr+="<div style='float:left;'>";
					htmstr+='<input type="hidden" name="goodsCategory.icon" value="'+json.data.urls+'">';
					htmstr+='<img height="200px"src="'+json.data.urls+'"/>';
					htmstr+='<br/><a href="#" class="easyui-linkbutton" onclick="javascript:$(this).parent().remove();"><b>删除</b></a>';
					htmstr+='</div>';
					$("#img_div").append(htmstr);
					/*$('.easyui-linkbutton').linkbutton({    
					    iconCls: 'icon-remove'
					});*/ 
				}else{
					$.messager.alert('警告','文件上传出错');
				}
			},
			upload_complete_handler : uploadComplete,
			// Button Settings
			button_placeholder_id:"upbtn",
			button_image_url : "/img/SmallSpyGlassWithTransperancy_17x18.png",
			button_width: 80,
			button_height: 18,
			button_text : '<span class="button">上传图片</span>',
			button_text_style : '.button {font-size: 12pt; }',
			button_text_top_padding: 0,
			button_text_left_padding: 18,
			button_disabled : false,
			button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
			button_cursor: SWFUpload.CURSOR.HAND,
			// Flash Settings
			flash_url : swfuploaddir+"/swfupload.swf",
			flash9_url : swfuploaddir+"/swfupload_fp9.swf",
			custom_settings : {
			//	upload_target : "divFileProgressContainer",
				thumbnail_height: 500,
				thumbnail_width: 500,
				thumbnail_quality: 100
			},
			debug: true
		});
    
	    $("#shop_id").combobox({    
		    url: '/shop/combobox',   
		    valueField:'id',    
		    textField:'name',
		    required: true,
		    width:122
		}); 
	});
</script>
<form method="post" id="editForm" name="editForm">
	<input type="hidden" name="goodsCategory.id" value="${(po.id)!}" id="poid">
	<div id="tt" class="easyui-tabs" style="width: 786px; height: 450px;">
		<div title="分类信息" style="padding: 5px;">
			<table class="tableForm tableCss">
				<tr>
					<th><font color=red>*</font>所属商铺</th>
					<td><input id="shop_id" name="goodsCategory.shop_id" value="${(po.shop_id)!}"></td>
				</tr>
				<tr>
					<th><font color=red>*</font>分类名称</th>
					<td>
						<input type="text" name="goodsCategory.name" class="easyui-validatebox" 
						value="${(po.name)!}" data-options="required:true"/>
					</td>
				</tr>
				<tr>
					<th><font color=red>*</font>分类背景图片</th>
					<td>
						<div title="图片" style="padding:5px;">
							<div class="tableForm datagrid-toolbar" >
								<div style="width:60px;border:1px;">
									<span id="upbtn"></span>
								</div>
								<div id="img_div">
									<#if po?? && po.icon??>
									<div style='float:left;'>
										<input type="hidden" name="goodsCategory.icon" value="${(po.icon)!}">
										<img src="${(po.icon)!}" height="200px"/>
										<br/>
										<a href="#" class="easyui-linkbutton" onclick="javascript:$(this).parent().remove();"><b>删除</b></a>
									</div>
									</#if>
								</div>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>